<?php

$server->wsdl->addComplexType
(
    'searchFields',
    'complexType',
    'struct',
    'all',
    '',
    array
    (
        'field_name' => array('name'=>'field_name','type'=>'xsd:string'),
        'main_relevance' => array('name'=>'main_relevance','type'=>'xsd:int'),
        'sub_relevance' => array('name'=>'sub_relevance','type'=>'xsd:int'),
    )
);

$server->wsdl->addComplexType
(
    'searchFieldsArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:searchFields[]')
    ),
    'tns:searchFields'
);

$server->wsdl->addComplexType
(
    'searchTables',
    'complexType',
    'struct',
    'all',
    '',
    array
    (
        'table_position' => array('name'=>'table_position','type'=>'xsd:string'),
        'table_catalogue' => array('name'=>'table_catalogue','type'=>'xsd:string'),
        'catalogue_field' => array('name'=>'catalogue_field','type'=>'xsd:string'),
        'fields' => array('name'=>'fields','type'=>'tns:searchFieldsArray'),
        'sub_relevance' => array('name'=>'sub_relevance','type'=>'xsd:searchFieldsArray'),
    )
);

 $server->wsdl->addComplexType
 (
     'searchTablesArray',
     'complexType',
     'array',
     '',
     'SOAP-ENC:Array',
     array(),
     array(
         array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:searchTables[]')
     ),
     'tns:searchTables'
 );

$server->wsdl->addComplexType
(
    'searchGroup',
    'complexType',
    'struct',
    'all',
    '',
    array
    (
        'name' => array('name'=>'name','type'=>'xsd:string'),
        'tables' => array('name'=>'tables','type'=>'tns:searchTablesArray'),
        'header_table' => array('name'=>'header_table','type'=>'xsd:string'),
        'header_field' => array('name'=>'header_field','type'=>'xsd:string'),
        'link' => array('name'=>'link','type'=>'xsd:string'),
        'link_id' => array('name'=>'link_id','type'=>'xsd:string'),
    )
);

$server->register('searchGroup',array(),array('ret' => 'tns:searchGroup'),$namespace,$namespace . '/searchGroup','rpc','encoded');

function searchGroup()
{
	global $search_group;
	return $search_group;
}

?>